<div class="row-fluid">
    <a style="border:1px solid #ccc" class="block-heading" data-toggle="collapse">列表数据</a>
    <div class="well">
        <span style="float:right;margin-top: 15px;">已审核充值金额：<div id="allka" style="display:inline"><img src="/statics/images/ajax_loading.gif" /></div> 元    </span>
        <script>
            $(function(){
                $.post('/recharge/tongji',{},function(data){
                    $('#allka').html(data.count);
                },'json')
            })
        </script>

        <div class="btn-toolbar">
            <form>
                <!--<label style="display: inline;">充值人：</label><input class="input input-medium" type="text" value="<?=I('get.user_name')?>" name="user_name"/>-->
                <label style="display: inline;">&nbsp;&nbsp;手机号：</label><input class="input input-medium" type="text" value="<?=I('get.user_mobile')?>" name="user_mobile" style="width: 100px;"/>
                <label style="display: inline; margin-left: 10px">积分类型：</label>
                <select name="score_type" style=" width: 100px;">
                    <option value="0" <if condition="I('get.score_type') eq 0">selected="selected"</if>>全部</option>
                    <option value="1" <if condition="I('get.score_type') eq 1">selected="selected"</if>>普通积分</option>
                    <option value="2" <if condition="I('get.score_type') eq 2">selected="selected"</if>>白金积分</option>
                    <option value="3" <if condition="I('get.score_type') eq 3">selected="selected"</if>>钻石积分</option>
                    <option value="5" <if condition="I('get.score_type') eq 5">selected="selected"</if>>黄金积分</option>
                    <option value="6" <if condition="I('get.score_type') eq 6">selected="selected"</if>>口腔积分</option>
                </select>
                <label style="display: inline; margin-left: 10px">审核状态：</label>
                <select name="is_check" style=" width: 100px;">
                    <option value="2" <?php if(I('get.is_check') == '' || I('get.is_check') == '2'){echo 'selected';}?>>全部</option>
                    <option value="-1" <?php if(I('get.is_check') == '-1'){echo 'selected';}?>>已取消</option>
                    <option value="0" <?php if(I('get.is_check') === '0'){echo 'selected';}?>>未审核</option>
                    <option value="1" <?php if(I('get.is_check') === '1'){echo 'selected';}?>>已审核</option>
                </select>

                <input type="hidden" value="<?=I('get.res')?>" name="res" />
                <button class="btn btn-info" style="margin:-9px 0 0 15px"><i class="icon-search"></i> 搜索</button>
            </form>
        </div>
        <hr>
        <?php
            $score_type = ['','普通积分','白金积分','钻石积分','体验积分','黄金积分','口腔积分'];
        ?>
        <table class="table">
            <thead>
            <tr>
                <th style="text-align:center;vertical-align:middle">序号</th>
                <th style="text-align:center;vertical-align:middle">充值人</th>
                <th style="text-align:center;vertical-align:middle">手机号</th>
                <th style="text-align:center;vertical-align:middle">充值积分类型</th>
                <th style="text-align:center;vertical-align:middle">充值金额</th>
                <th style="text-align:center;vertical-align:middle">状态</th>
                <th style="text-align:center;vertical-align:middle">备注</th>
                <th style="text-align:center;vertical-align:middle">充值时间</th>
                <th style="text-align:center;vertical-align:middle">审核时间</th>
                <th style="text-align:center;vertical-align:middle">操作</th>
            </tr>
            </thead>
            <tbody>
            <?php if($getData){foreach($getData AS $key=>$val){ ?>
            <tr>
                <td style="text-align:center;vertical-align:middle"><?=$val['recharge_id']?></td>
                <td style="text-align:center;vertical-align:middle"><?=$val['user_name']?></td>
                <td style="text-align:center;vertical-align:middle"><?=$val['user_mobile']?></td>
                <td style="text-align:center;vertical-align:middle"><span style="color: <?=$val['score_type']==1?'':($val['score_type']==2?'#71E2FA':'orange')?>"><?=$score_type[$val['score_type']]?></span></td>
                <td style="text-align:center;vertical-align:middle"><?=$val['recharge_money']?></td>
                <td style="text-align:center;vertical-align:middle">
                    <?php if($val['is_check'] == '1'){?>
                        <span class="label label-info">已审核</span>
                    <?php }elseif($val['is_check'] == '-1'){?>
                        <span class="label label-danger">已取消</span>
                    <?php }else{?>
                        <span class="label label-warning">未审核</span>
                    <?php }?>
                </td>
                <td style="text-align:center;vertical-align:middle"><?=$val['remark']?></td>
                <td style="text-align:center;vertical-align:middle"><?=$val['add_at']?date('Y-m-d H:i',$val['add_at']):'-'?></td>
                <td style="text-align:center;vertical-align:middle"><?=$val['check_at']?date('Y-m-d H:i',$val['check_at']):'-'?></td>
                <td style="text-align:center;vertical-align:middle">
                    <?php if($val['is_check'] == '0'){?>
                        <a class="ifrm btn btn-info" href="javascript:void(0)" data-url="/recharge/checkRecharge" data-width="500" data-height="370" data-title="审核充值" data-params="recharge_id/<?=$val['recharge_id']?>" style="padding: 0px 4px;">通过审核</a>&nbsp;&nbsp;
                        <a class="ifrm btn btn-info" href="javascript:void(0)" data-url="/recharge/delRecharge" data-width="500" data-height="370" data-title="审核取消" data-params="recharge_id/<?=$val['recharge_id']?>" style="padding: 0px 4px;">取消审核</a>&nbsp;&nbsp;
                    <?php }?>
                </td>
            </tr>
            <?php }}else{?>
            <td style="text-align:center;" colspan=10>暂无数据</td></tbody>
            <?php }?>
        </table>
        <span style="float:right;margin-top:-44px"><?=$page?></span>
    </div>
</div>
<script>
    $('.decard').live('click',function(){
        if(!window.confirm('确认删除改卡券吗 ?')){
            return false;
        }
        window.location = $(this).attr('href');
    });

    $('input[name="user_mobile"]').on('keyup',function(){
       $(this).val($(this).val().replace(/[^\d]/g,''));
    });
</script>